package com.itqf.dao;

import com.itqf.pojo.Address;

import java.sql.SQLException;
import java.util.List;

/**
 * projectName: gpshop
 *
 * @author: 赵伟风
 * time: 2021/7/22 10:33
 * description:
 */
public interface AddressDao {

    /**
     * 根据用户id查询存在的地址数量
     * @param getuId
     * @return
     */
    long queryCount(int getuId) throws SQLException;

    /**
     * 保存地址信息
     * @param address
     * @return
     */
    int insertAddress(Address address) throws SQLException;

    /**
     * 根据用户id查询地址信息
     *
     * @param uid
     * @return
     */
    List<Address> queryAll(int uid) throws SQLException;

    /**
     * 取消全部默认地址
     * @param uId
     * @return
     */
    int updateState(int uId) throws SQLException;

    /**
     * 设置新的默认地址
     * @param aId
     */
    void setDefualt(String aId) throws SQLException;
}
